package me.leiusual.sharing.api.model.cartdetail

data class CartX(
    val cartId: Long,
    val userId: Int,
    val productId: Int,
    val productName: String,
    val productImage: String,
    val productType: String,
    val quantity: Int,
    val inventory: Int,
    val floor: Int,
    val salePrice: Int,
    val priceVos: List<PriceVo>,
    val purchasePrice: Int,
    val creditPoints: Int,
    val pointCoins: Int,
    val storeId: Int,
    val storeCode: String,
    val storeName: String,
    val storeAreaId: Int,
    val storeAreaCode: String,
    val storeAreaName: String,
    val storeAreaType: String,
    val modelId: Int,
    val modelInAreaId: Int,
    val independentFreight: Double,
    val valid: Boolean,
    val updateTime: String,
    val referStoreId: Int?,
    val referStoreName: String?,
    val referStoreCode: String?,
    val maxCount: Int?,
    val categoryId: Any?,
    val categoryName: Any?,
    val deliveryStoreId: Any?,
    val deliveryStoreName: Any?,
    val deliveryStoreCode: Any?,
    val modelName: String,
    val modelDesc: String?,
    val promotions: Any?,
    val userCouponVoList: Any?
) {

  var checked: Boolean? = null
    get() {
      if (field == null) {
        field = false
      }
      return field
    }

  var amount: Int? = null
    get() {
      if (field == null) {
        field = quantity
      }
      return field
    }
}